//
//  ScoreTeacherViewController.m
//  edu
//
//  Created by baobaodp on 13-8-27.
//  Copyright (c) 2013年 baobaodp. All rights reserved.
//

#import "ScoreTeacherViewController.h"
#import "EduViewController.h"
#import "DBbase.h"
#import "Record.h"

@interface ScoreTeacherViewController ()

@end

@implementation ScoreTeacherViewController

@synthesize tch_Id;
@synthesize teachYears;
@synthesize name;
@synthesize birth;
@synthesize imgView;
@synthesize m_record;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    [self setTitle:@"任课老师"];
    
    m_record = [[Record alloc]initWithTableName:@"M_Teacher"];
    [m_record addKeyField:@"tch_Id" value:self.tch_Id];
    [m_record loadFromDB];
    
    self.name.text = [m_record getFieldValueByName:@"tch_Name"];
    self.birth.text = [m_record getFieldValueByName:@"tch_Birth"];
    self.teachYears.text = [m_record getFieldValueByName:@"tch_Date"];

    UIImage *img=[UIImage imageWithData:[m_record getFieldDataByName:@"tch_Img"]];
    if(img != nil){
        self.imgView.image =img;
    }
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
